package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * -邮寄表 实体类
 * @author ming
 *
 */

@Entity
@Table(name="sys_mailing")
@NamedQuery(name="SysMailing.findAll", query="SELECT s FROM SysMailing s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysMailing implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private BigInteger id;//

	@ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="repository_id")
	private SysRepository sysRepository;//仓库ID
	
	@ManyToOne(fetch=FetchType.LAZY)
   	@NotFound(action=NotFoundAction.IGNORE)
   	@JoinColumn(name="address_id")
	private ReceivingAddress receivingAddress;//收货地址ID
	
	@Column(name="product_num")
	private BigInteger productNum;//产品数量
	
	@Column(name="state")
	private BigInteger state;//1:已发货2:未发货
	
	@Column(name="is_delete")
	private BigInteger isDelete;//
	
	@Column(name="is_check")
	private BigInteger isCheck;//

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="add_time")
	private Date addTime;//添加时间
	
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="user_id")
    private User userId;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="assets_id")
	private SysAssets assetsId;   // 资产ID
	
	
	public User getUserId() {
		return userId;
	}


	public void setUserId(User userId) {
		this.userId = userId;
	}


	public SysAssets getAssetsId() {
		return assetsId;
	}


	public void setAssetsId(SysAssets assetsId) {
		this.assetsId = assetsId;
	}


	public ReceivingAddress getReceivingAddress() {
		return receivingAddress;
	}


	public void setReceivingAddress(ReceivingAddress receivingAddress) {
		this.receivingAddress = receivingAddress;
	}


	public Date getAddTime() {
		return addTime;
	}


	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}


	public BigInteger getId() {
		return id;
	}


	public void setId(BigInteger id) {
		this.id = id;
	}


	public BigInteger getProductNum() {
		return productNum;
	}


	public void setProductNum(BigInteger productNum) {
		this.productNum = productNum;
	}


	public BigInteger getState() {
		return state;
	}


	public void setState(BigInteger state) {
		this.state = state;
	}


	public BigInteger getIsDelete() {
		return isDelete;
	}


	public void setIsDelete(BigInteger isDelete) {
		this.isDelete = isDelete;
	}


	public BigInteger getIsCheck() {
		return isCheck;
	}


	public void setIsCheck(BigInteger isCheck) {
		this.isCheck = isCheck;
	}

	

	public SysRepository getSysRepository() {
		return sysRepository;
	}


	public void setSysRepository(SysRepository sysRepository) {
		this.sysRepository = sysRepository;
	}


	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	
	
}
